package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.pojo.entity.VendingMachine;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * \* User: chy
 * \* Date: 2025/8/17   17:54
 * \* Description:
 * \
 */
@Mapper
public interface VendingMachineMapper  extends BaseMapper<VendingMachine> {
    /*
    * 根据nodeId统计投放的售货机数量
    * */
    List<Map<String, Object>> getNodeIds(List<String> tbNodeIds);

    @Select("select count(*) from tb_vending_machine where node_id= #{nodeId}")
    int getByNodeId(String nodeId);

    @Select("select * from tb_vending_machine where node_id = #{nodeId}")
    List<VendingMachine> findByNodeId(String nodeId);
}
